home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / phagexsources.lha / codesegments / KillSysAGA-Seg.s < prev    next >
Encoding:
Text File  |  1993-08-21  |  3.0 KB  |  163 lines

  1. *****************************************************************************
  2. * Complete System Killer, A500-A4000 V1.3 / V3.0, ECS/AGA,  by Phagex '93   *
  3. * Segment Version 1.0                                                       *
  4. *****************************************************************************
  5. * Killsys returns with:-                                                    *
  6. * d0 = Processor Type (d0 = x : 680x0 = 0 to 4),                            *
  7. * d1 = Bit #0 set if AGA, Bit #1 Set if V39 GFX lib available.              *
  8. * a0 = GFX Base (either V0 or V39)                                          *
  9. * a1 = Vector Base Register (68010++)                                       *
  10. *****************************************************************************
  11.  
  12.     Opt    c-
  13.     Section    "Full System Killer",Code_C
  14.  
  15. Start    Bra.s    KillSys
  16.     Bra    ReturnSys
  17.     
  18. KillSys    Bsr    CheckSystem
  19.     Move.l    GFXBase(pc),a6
  20.     Lea    WBView(pc),a0
  21.     Move.l    34(a6),(a0)    
  22.     Sub.l    a1,a1
  23.     Jsr    -222(a6)    
  24.     Jsr    -270(a6)    
  25.     Jsr    -270(a6)    
  26.     Move.l    4.w,a6
  27.     Jsr    -132(a6)    
  28.     Lea    $Dff000,a6
  29.     Lea    SaveRegs(pc),a0
  30.     Move.w    2(a6),d0
  31.     Or.w    d0,(a0)+
  32.     Move.w    $1c(a6),d0    
  33.     Or.w    d0,(a0)+
  34.     Move.w    #$7fff,d0    
  35.     Moveq    #0,d1
  36.     Move.w    d0,$96(a6)    
  37.     Move.w    d0,$9a(a6)    
  38.     Move.w    d0,$9c(a6)    
  39.     Move.w    d1,$1fc(a6)    
  40.     Move.w    d1,$106(a6)    
  41.     Move.w    #%10001,$10c(a6)
  42.     Lea    ProcStats(pc),a6
  43.     Move.w    (a6)+,d0
  44.     Move.w    (a6)+,d1
  45.     Move.l    (a6)+,a0
  46.     Move.l    (a6)+,a1
  47.     Rts
  48.  
  49. ReturnSys    Lea    $Dff000,a6
  50.     Move.w    #$7fff,d0
  51.     Move.w    d0,$96(a6)
  52.     Move.w    d0,$9a(a6)
  53.     Move.w    d0,$9c(a6)
  54.     Lea    SaveRegs(pc),a0
  55.     Move.w    (a0)+,$96(a6)
  56.     Move.w    (a0)+,$9a(a6)
  57.     Move.l    4.w,a6
  58.     Jsr    -138(a6)
  59.     Move.l    GFXBase(pc),a6
  60.     Move.l    WBView(pc),a1
  61.     Jsr    -222(a6)
  62.     Move.l    38(a6),$dff080
  63.     Move.l    a6,a1
  64.     Move.l    4.w,a6
  65.     Jsr    -414(a6)
  66.     Moveq    #0,d0
  67.     Rts
  68.  
  69. CheckSystem    Move.l    $4.w,a6
  70.     Sub.l    a1,a1
  71.     Btst    #0,$129(a6)
  72.     Beq    GetVecBase
  73.     Lea    FetchVectorBase(pc),a5
  74.     Jsr    -$1e(a6)
  75.     Bra    GetVecBase
  76.     
  77. FetchVectorBase    Movec    vbr,a1
  78.      Rte
  79.  
  80. GetVecBase    Lea    VBRBase(pc),a0
  81.     Move.l    a1,(a0)
  82.     Lea    ProcStats(pc),a1
  83.     Move.l    #0,(a1)
  84.  
  85. cachetest    Move.l    $4.w,a6
  86.     Btst    #3,$129(a6)
  87.     Bne    Found040
  88.     Btst    #2,$129(a6)
  89.     Bne    Found030
  90.     Btst    #1,$129(a6)
  91.     Bne    Found020
  92.     Btst    #0,$129(a6)
  93.     Bne    Found010
  94.     Bra    CheckAGA
  95.  
  96. Found040    Move.w    #4,(a1)
  97.     Move.l    $4.w,a6
  98.     Lea    NoCaches040(pc),a5
  99.     Jsr    -$1e(a6)
  100.     Bra    CheckAGA
  101. Found030    Move.w    #3,(a1)
  102.     Bra    Found020_030
  103. Found020    Move.w    #2,(a1)
  104.     
  105. Found020_030    Move.l    $4.w,a6
  106.     Lea    NoCaches020_030(pc),a5
  107.     Jsr    -$1e(a6)
  108.     Bra    CheckAGA
  109. Found010    Move.w    #1,(a1)
  110.     Bra    CheckAGA
  111.     
  112. NoCaches040    Movec    cacr,d0
  113.     Bclr.l    #31,d0
  114.     Bclr.l    #15,d0
  115.     Movec    d0,cacr
  116.     Rte
  117. NoCaches020_030    Movec    cacr,d0
  118.     Bclr    #8,d0
  119.     Bclr    #0,d0
  120.     Movec    d0,cacr
  121.     Rte
  122.  
  123. CheckAGA    Move.w    $Dff07c,d0
  124.     Cmp.b    #$f8,d0
  125.     Bne    NotAGA
  126.     
  127.     Lea    VerStats(pc),a1
  128.     Move.w    #1,(a1)
  129.     
  130.     Moveq    #39,d0
  131.     Bsr    GetGFXLib
  132.     Tst.l    d0
  133.     Bne    GotV39Lib
  134.         
  135. NotAGA    Moveq    #0,d0
  136.     Bsr    GetGFXLib
  137.     Tst.l    d0
  138.     Bne    GotGFXBase
  139.     Rts
  140.     
  141. GotV39Lib    Lea    VerStats(pc),a1
  142.     Or.w    #2,(a1)
  143.  
  144. GotGFXBase    Lea    GFXbase(pc),a0
  145.     Move.l    d0,(a0)
  146.     Rts
  147.  
  148. GetGFXLib    Move.l    $4.w,a6
  149.     Lea    GFXName(pc),a1
  150.     Jsr    -$228(a6)
  151.     Rts
  152.     
  153. GFXName    Dc.b    "graphics.library",0
  154.     Even
  155.     
  156. ProcStats    Dc.w    0
  157. VerStats    Dc.w    0
  158. GFXBase    Dc.l    0
  159. VBRBase    Dc.l    0
  160. SaveRegs    Dc.l    $8000c000,0
  161. WBView    Dc.l    0
  162.  
  163.